package com.example.dict.utils;

public class ApiUtil {
//    根据拼音查询
    public static String pinyinurl ="http://v.juhe.cn/xhzd/querypy?key=";
//    根据部首查询
    public static String bushouurl ="http://v.juhe.cn/xhzd/querybs?key=";

    public static final String DICKEY = "ec067d252c5489ddae6957a1f1cd061d";
// 根据汉字查询字典
    public static String wordurl ="http://v.juhe.cn/xhzd/query?key=";

//    成语查询
    public static final String CHYUKEY = "731e121977a0ce5ab29808a9a5895101";
    public static String chengyuurl="http://apis.juhe.cn/idioms/query?key=";


    public static String getPinyinurl(String word,int page, int pagesize) {
        String url = pinyinurl+DICKEY+"&word="+word+"&page="+page+"&pagesize="+pagesize;
        return url;
    }

    public static String getBushouurl(String bs,int page, int pagesize) {
        String url = bushouurl+DICKEY+"&word="+bs+"&page="+page+"&pagesize="+pagesize;
        return url;
    }



    public static String getWordurl(String word) {
        String url = wordurl+DICKEY+"&word="+word;
        return url;
    }


    public static String getChengyuurl(String word) {
        String url = chengyuurl+CHYUKEY+"&wd="+word;
        return url;
    }
}
